# coding:utf-8

def calc():
    list1=[]

    for i  in range (1,101):
        icon=False
        if i==1 or i==2:
            icon = True
        else:
            for y in range(2,i):
                if i%y ==0:
                    icon=False
                    break     #判断如非质数即终止循环
                else:
                    icon = True
        if icon:
            if i <= 10:
                list1.append(i**2)
            print('%d是质数'%i)
    print('小于10的数字对应平方值为',list1)

if __name__ == '__main__':
    calc()